home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / unixcpio.gz / unixnet.cpio / smtp.h < prev    next >
C/C++ Source or Header  |  1994-07-11  |  3KB  |  94 lines

  1. #define SMTPTRACE            /* enable tracing for smtp */
  2. #define MAXSESSIONS    10        /* most connections allowed */
  3. #define JOBNAME        13        /* max size of a job name with null */
  4. #define    LINELEN        128
  5. #define SLINELEN    32
  6. #define MBOXLEN        8        /* max size of a mail box name */
  7.  
  8.  
  9. /* types of address used by smtp in an address list */
  10. #define BADADDR    0
  11. #define LOCAL    1
  12. #define DOMAIN    2
  13.  
  14. /* a list entry */
  15. struct list {
  16.     struct list *next;
  17.     char *val;
  18.     char type;
  19. };
  20.  
  21.  
  22. /* Per-session control block  used by smtp server */
  23. struct mail {
  24.     struct tcb *tcb;    /* TCP control block pointer */
  25.     char state;
  26. #define    COMMAND_STATE    0
  27. #define    DATA_STATE    1
  28.     char *system;        /* Name of remote system */
  29.     char *from;        /* sender address */
  30.     struct list *to;    /* Linked list of recipients */
  31.     char buf[LINELEN];    /* Input buffer */
  32.     char cnt;        /* Length of input buffer */
  33.     FILE *data;        /* Temporary input file pointer */
  34. };
  35.  
  36. /* used by smtpcli as a queue entry for a single message */
  37. struct smtp_job {
  38.     struct     smtp_job *next;    /* pointer to next mail job for this system */
  39.     char    jobname[9];    /* the prefix of the job file name */
  40.     char    *from;        /* address of sender */
  41.     struct list *to;    /* Linked list of recipients */
  42. };
  43.  
  44. /* control structure used by an smtp client session */
  45. struct smtp_cb {
  46.     struct tcb *tcb;    /* tcp task control buffer */
  47.     int32    ipdest;        /* address of forwarding system */
  48.     char     state;        /* state machine placeholder */
  49. #define CLI_INIT_STATE    0
  50. #define CLI_OPEN_STATE    1
  51. #define    CLI_HELO_STATE    2
  52. #define CLI_MAIL_STATE    3
  53. #define CLI_RCPT_STATE    4
  54. #define    CLI_SEND_STATE    5
  55. #define    CLI_UNLK_STATE    6
  56. #define CLI_QUIT_STATE    7
  57. #define CLI_IDLE_STATE    8
  58.     char    *wname;        /* name of workfile */
  59.     char    *tname;        /* name of data file */
  60.     char    buf[LINELEN];    /* Input buffer */
  61.     char    cnt;        /* Length of input buffer */
  62.     FILE    *tfile;
  63.     struct    smtp_job *jobq;
  64.     char    goodrcpt;    /* are any of the rcpt ok */
  65.     char    cts;        /* clear to send state indication */
  66.     int    rcpts;        /* number of unacked rcpt commands */
  67.     struct    list     *errlog;    
  68. };
  69.  
  70. /* smpt server routing mode */
  71. #define    QUEUE    1
  72.  
  73. #define    NULLLIST    (struct list *)0
  74. #define    NULLMAIL    (struct mail *)0
  75. #define    NULLCB        (struct smtp_cb *)0
  76. #define NULLJOB        (struct smtp_job *)0
  77.  
  78.  
  79. extern char *mailspool;
  80. extern char *mailqdir;        /* Outgoing spool directory */
  81. extern char *routeqdir;    /* spool directory for a router program */
  82. extern char *mailqueue;    /* Prototype of work file */
  83. extern char *maillock;        /* Mail system lock */
  84. extern char hostname[];
  85. extern char *alias;
  86. extern int32 mailroute();
  87. extern int mlock(),rmlock(),queuejob();
  88. extern char *ptime();
  89. extern void del_list();
  90. extern long get_msgid();
  91. extern int16 smtpmode;
  92. extern char *fgets();
  93. extern struct list *addlist();
  94.